<template>
  <div class="dashboard-container">
    <!-- 3D立方体容器 -->
    <div class="cube-container">
      <!-- 其他立方体 -->
      <div class="cube" style="--x: 0; --y: 0;">
        <div class="face front">其他</div>
        <div class="face top">12563</div>
        <div class="face side">12563</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CubeChart'
}
</script>

<style scoped>
.dashboard-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: #0a1128;
  color: white;
  min-height: 100vh;
}

.cube-container {
  position: relative;
  width: 500px;
  height: 500px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.cube {
  position: absolute;
  width: 120px;
  height: 120px;
  transform-style: preserve-3d;
  transform: rotateX(var(--x)) rotateY(var(--y));
  transition: transform 0.5s ease;
}

.cube:hover {
  transform: rotateX(calc(var(--x) + 10deg)) rotateY(calc(var(--y) + 10deg));
}

.face {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 4px;
  background: linear-gradient(135deg, #00ff00, #009900);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  text-align: center;
  color: #ffd700;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

/* 前面的面 */
.front {
  transform: translateZ(60px);
  background: linear-gradient(135deg, #00ff00, #009900);
  color: #ffffff;
  font-size: 14px;
  z-index: 1;
}

/* 上面的面 */
.top {
  transform: rotateX(-90deg) translateZ(60px);
  background: linear-gradient(135deg, #00cc00, #006600);
  color: #ffd700;
  font-size: 16px;
  z-index: 2;
}

/* 侧面的面 */
.side {
  transform: rotateY(90deg) translateZ(60px);
  background: linear-gradient(135deg, #00cc00, #006600);
  color: #ffd700;
  font-size: 16px;
  z-index: 2;
}

/* 立方体边框效果 */
.cube::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid #00bfff;
  border-radius: 4px;
  pointer-events: none;
  z-index: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 10px;
  }
  
  .cube-container {
    width: 400px;
    height: 400px;
  }
  
  .cube {
    width: 100px;
    height: 100px;
  }
  
  .face {
    width: 100px;
    height: 100px;
  }
  
  .front {
    transform: translateZ(50px);
  }
  
  .top {
    transform: rotateX(-90deg) translateZ(50px);
  }
  
  .side {
    transform: rotateY(90deg) translateZ(50px);
  }
}
</style>